﻿Imports Microsoft.Practices.EnterpriseLibrary.Data
Imports Seuss.EnterpriseLibrary.DataAccess
Imports Seuss.EnterpriseLibrary.BusinessLogic
Imports System.Web
Imports System.Data

Partial Class Consulta_DO_CursoAsignado
    Inherits System.Web.UI.Page
    Dim nCurGruCodigo As String

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Request.QueryString("nCurGruCodigo") Is Nothing Or Request.QueryString("nCurGruCodigo") Is String.Empty Then
            If Session("nCurGruCodigo") Is Nothing Or Session("nCurGruCodigo") Is String.Empty Then
                Response.Redirect("Do_ListaCursAsig.aspx")
            End If
        Else
            Session("nCurGruCodigo") = Request.QueryString("nCurGruCodigo")
        End If

        If Request.QueryString("nGruCodigo") Is Nothing Or Request.QueryString("nGruCodigo") Is String.Empty Then
            If Session("nGruCodigo") Is Nothing Or Session("nGruCodigo") Is String.Empty Then
                Response.Redirect("Do_ListaCursAsig.aspx")
            End If
        Else
            Session("nGruCodigo") = Request.QueryString("nGruCodigo")
        End If

        nCurGruCodigo = Request.QueryString("nCurGruCodigo")
        Response.Expires = -1
        Response.AddHeader("Pragma", "no-cache")
        Response.AddHeader("cache-control", "private")
        Response.CacheControl = "no-cache"
        If Not Page.IsPostBack Then
            Dim ldrCurso As New List(Of IDataReader)
            Using ObjPool As New PoolDbCommand()
                Dim ObjUsuario As New DAL_Kiosco(ObjPool.Database)
                ObjPool.AddDbCommand(ObjUsuario.Get_InformacionCurso_By_nCurGruCodigo(nCurGruCodigo), PoolDbCommand.PoolDbCommandResultType.Query)
                ObjPool.Pooling(Nothing, ldrCurso, True)
            End Using
            While ldrCurso(0).Read
                lblCursoAsig.Text = ldrCurso(0).Item("casidescripcion").ToString
                lblCurGruCodigo.Text = nCurGruCodigo.ToString
                Session("cursoasignado") = lblCursoAsig.Text
            End While
            Using Seguridad As New BLL_Administracion
                Seguridad.Set_Transaccion_Insert(Nothing, 100401, IdentityUser.UserCode, My.Request.UserHostAddress.ToString, CrearXMLTransaccion("Consulta Pagina Movil", "/Pagina|" + My.Request.Url.Segments(My.Request.Url.Segments.Length - 1).ToString))
            End Using
        End If
    End Sub

End Class